package com.example.iccil.test;

import com.example.iccil.model.enums.UserRoleEnum;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;


public class testDemo {
    public static void main(String[] args) {
        List<UserRoleEnumVo> collect = Arrays.stream(UserRoleEnum.values())
                .map(userRoleEnum -> new UserRoleEnumVo(
                        userRoleEnum.getText(),
                        userRoleEnum.getValue()
                )).collect(Collectors.toList());
        System.out.println("collect = " + collect);
    }

    public static Optional<Member> getMember(){
        boolean hasName = false;
        if (hasName){
            return Optional.of(new Member("yolo"));
        }else {
            return Optional.empty();
        }
    }

}
class Member {
    private String name;

    public Member(String name){
        this.name = name;
    }

    public String getName(){
        return this.name;
    }

    public void setName(String name){
        this.name = name;
    }
}

@AllArgsConstructor
@Data
class UserRoleEnumVo{
    private String text;

    private String value;
}